package test.myorm;

import java.io.InputStream;

import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import test.myorm.demo.User;
import test.myorm.demo.mapper.UserMapper;

public class App3 {
	
	public static void main(String[] args) {
		InputStream in = App3.class.getResourceAsStream("/mybatis/config/config.xml");
		SqlSessionFactory sessionFactory = new SqlSessionFactoryBuilder().build(in);
		SqlSession sqlSession = sessionFactory.openSession();
		UserMapper userMapper = sqlSession.getMapper(UserMapper.class);
		User user = userMapper.getUserById(1);
		System.out.println(user);
	}

}
